<?php
    $xtpl_header    = new XTemplate("view/header.htm");
    
    $username   = $_POST['user'];
    
	if(!$_SESSION['member']){
		$xtpl_header  -> parse("HEADER.GUEST");
	}
    else{
        $sql    = "SELECT * FROM member WHERE username='" . $_SESSION['member'] . "'";
        $result = mysql_query($sql);
        $row    = mysql_fetch_array($result);
        $xtpl_header  -> assign('username', $row['username']);
        $xtpl_header  -> assign('id', $row['id_m']);
        $xtpl_header  -> parse("HEADER.USER");
    }

    $xtpl_header    -> parse("HEADER");
    $header         = $xtpl_header -> text("HEADER");
?>